package test;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class SetImage extends JFrame {

	/**
	 * Create the panel.
	 */
	public SetImage() {
		final ImageIcon icon = new ImageIcon("player1.jpg");
		JPanel p1 = new JPanel() {	
			public void paintComponent(Graphics g){
					Dimension d = getSize(); 
			        g.drawImage(icon.getImage(), 0, 0, d.width, d.height, null); 
			        setOpaque(false); 
			        super.paintComponent(g); 
			}
		};
		add(p1);
		setSize(40,80);
		setVisible(true);
	}
	public static void main(String args[]){
		new SetImage();
	}
}
